<?php
/**
 * Created by yuxianjun001@icloud.com
 * User: yuxianjun
 * Date: 2018/3/19 0019
 * Time: 上午 11:16
 */

namespace App\Http\Controllers;
use  App\Http\Controllers\common\MyController;
use Curl\Curl;

class CurlTestController extends MyController
{
    public function index(){
        $curl=new Curl();
        $curl->setOpt(CURLOPT_RETURNTRANSFER, TRUE);
        $curl->setOpt(CURLOPT_SSL_VERIFYPEER, FALSE);
       // curl_set_opt($curl->curl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1');
        $curl->get('https://encrypted.example.com/');
        curl_close($curl->curl);
        if ($curl->error) {
            echo $curl->error_code;
        }
        else {
            echo $curl->response;
        }

    }

}